/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024.
 * Description: support long hw_breakpoint
 * Author: zhangningyi
 * Create: 2024-03-12
 */
#include <linux/signal.h>
#include <linux/rtos_sysctl.h>
#include <internal/long_hw_breakpoint.h>

#ifdef CONFIG_RTOS_DEBUG_WATCHPOINT_SIGNAL
unsigned int sysctl_watchpoint_signal;

void send_watchpoint_signal(unsigned long addr, struct task_struct *task)
{
	if (sysctl_watchpoint_signal) {
		pr_info("watchpoint fired: address = 0x%lx, pid:%d, comm:%s\n",
				addr, current->pid, current->comm);
		 send_sig_fault(SIGTRAP, TRAP_HWBKPT, (void __user *)addr, task);
	}
}
#endif
